<script type="text/javascript">

function search()
{
	var url="<?php
echo $this->url(array('controller' => 'result', 'action' => 'resultviz'), 
'default', true)?>"; 

var names="";
var start=document.getElementById("start").value;
var end=document.getElementById("end").value;

var nameCheckBoxes = document.getElementsByName("nameCheckBox");

for (var i = 0; i < nameCheckBoxes.length; i++)  
{  
	if (nameCheckBoxes[i].checked)  
	{  
		
		if(names.length!=0)
		{
    		names=names+","+nameCheckBoxes[i].value;  
		}
		else
		{
			names=nameCheckBoxes[i].value;  
			}
	}
}	 


//alert(names);
		url+="?names="+names+"&start="+start+"&end="+end;
//		alert(url);

		    xmlHttpRequest = createXmlHttpRequest();       
		    xmlHttpRequest.onreadystatechange = Callback;       
		    xmlHttpRequest.open("post",url,true); 
		    xmlHttpRequest.send(null);   
	
	}



function createXmlHttpRequest(){ 
    if(window.ActiveXObject){ 
        return new ActiveXObject("Microsoft.XMLHTTP"); 
    }else if(window.XMLHttpRequest){ 
        return new XMLHttpRequest(); 
    } 
}        

function Callback(){ 
    if(xmlHttpRequest.readyState == 4 && xmlHttpRequest.status == 200){
        var valueReturned = xmlHttpRequest.responseText;
		document.getElementById('content').innerHTML = valueReturned;
	    } 
}
</script>


<br />
开始轮数
<input type="text" name="startRound" id="start" />
结束轮数
<input type="text" name="endRound" id="end" />

<input type="button" name="search" onclick="search()" value="查询" />

<?php
echo "<img src=\"" . $this->imageSrc . "\">";
?>
<br />
<?php
$nameValues = $this->names;
$enNameValues = $this->enNames;
for ($i = 0; $i < sizeof($nameValues); $i ++) {
    echo "<input type=\"checkbox\" name=\"nameCheckBox\" value=\"" .
     $enNameValues[$i] . "\">$nameValues[$i]<br/>";
}
?>







